﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="VPCResumenByBusRoutes.aspx.cs" Inherits="GPSTrackingWebsiteManager.Manager.Pages.VPCResumenByBusRoutes" %>

<!DOCTYPE html>

<link href="../../Css/GPSTrackingWebsite.css" rel="stylesheet" />
<link href="../../Css/messi.css" rel="stylesheet" />
<script src="../../Javascript/jquery-1.11.1.min.js"></script>
<script src="../../Javascript/messi.js"></script>
<script src="../../Javascript/Custom.js"></script>
<script src="../../Javascript/WindowMessageManager.js"></script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>VCP Resumen de Rutas</title><telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
    <script type="text/javascript">
        function resizeGrid() {
            var tableView = $find("<%=rgResumenBusRoutesGrid.ClientID %>");
            tableView.get_element().style.height = (window.innerHeight - 125) + "px";

            document.getElementById('HiddenFieldHeight').value = (window.innerHeight);
        }

        //Windows Message Manager 
        var objWindowsMessageManager = new WindowsMessageManager();
        objWindowsMessageManager.run();

    </script>
</telerik:RadScriptBlock>
</head>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
</telerik:RadScriptBlock>
<body onresize="resizeGrid()" style="overflow: hidden">
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"  EnablePageMethods="true" EnablePartialRendering="true"></telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
				<telerik:AjaxSetting AjaxControlID="AjaxControlID1">
					<UpdatedControls>
						<telerik:AjaxUpdatedControl ControlID="Loading" LoadingPanelID="RadAjaxLoadingPanel1" />
					</UpdatedControls>
				</telerik:AjaxSetting>
			</AjaxSettings>
        </telerik:RadAjaxManager>
        
        <asp:HiddenField ID="HiddenFieldHeight" runat="server" Value="323" />
        <asp:HiddenField ID="HiddenFieldError" runat="server" Value="" />
        
                <fieldset>
                <legend>Resumen de Rutas</legend>
                <table style="width: 100%; text-align: left">
					<tr>
                        <td>
                            <fieldset>
                                <legend>Seleccione las fechas a Consultar</legend>
                                <telerik:RadDatePicker ID="beginDateSelected" runat="server" DateInput-Label="Fecha Desde" style="text-align: left" Height="24px" Width="200px" Calendar-CultureInfo="es-CR">
							        <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
			                        <DateInput DateFormat="dd/MM/yyyy" DisplayDateFormat="dd/MM/yyyy"  Height="24px" LabelWidth="50%"></DateInput>
		                        </telerik:RadDatePicker>

                                <telerik:RadDatePicker ID="endDateSelected" runat="server" DateInput-Label="Fecha Hasta" style="text-align: left" Height="24px" Width="200px" Calendar-CultureInfo="es-CR">
							        <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
			                        <DateInput DateFormat="dd/MM/yyyy" DisplayDateFormat="dd/MM/yyyy" Height="24px" LabelWidth="50%"></DateInput>
		                        </telerik:RadDatePicker>
                                &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
                                <telerik:RadButton ID="btnResumenBusRoutesSearch" runat="server" Text="Buscador" Height="32px" Width="32px" AutoPostBack="true" ToolTip="Consultar Resumen de Rutas" OnClick="btnResumenBusRoutesSearch_Click">
                                    <Image ImageUrl="../../Template/Icons/32px/Actions-document-find-icon.png" />
                                </telerik:RadButton>

                            </fieldset>                      
                        </td>
                    </tr>
                    </table>
                    </fieldset>
								<telerik:RadGrid ID="rgResumenBusRoutesGrid" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" Height="100%" OnNeedDataSource="rgResumenBusRoutesGrid_NeedDataSource" AllowSorting="true" GroupingSettings-CaseSensitive="false">
                                    
		                            <MasterTableView EditMode="PopUp" EditFormSettings-PopUpSettings-Modal="true" EditFormSettings-CaptionFormatString="Modo Edición" CommandItemDisplay="TopAndBottom" NoMasterRecordsText="No hay registros" AllowFilteringByColumn="true" TableLayout="Auto">
                                    <CommandItemTemplate>
                                        <div style="padding: 5px 5px;"> Resumen Rutas: 
                                                <asp:LinkButton ID="lbClearFilters" runat="server" OnClick="lbClearFilters_Click"  Visible='<%# !rgResumenBusRoutesGrid.MasterTableView.IsItemInserted %>'><img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/mixx-icon.png"/>Limpiar Filtros</asp:LinkButton>                                                                               
				                                <asp:LinkButton ID="lbShowError" runat="server" OnClick="lbShowError_Click" Visible='<%# HiddenFieldError.Value == string.Empty ? false : true %>'><img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/bug-icon.png"/>Error Técnico</asp:LinkButton>                                                                                                               
                                        </div>                        
                                    </CommandItemTemplate>

                                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </RowIndicatorColumn>

                                        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                        </ExpandCollapseColumn>

                                        <Columns>
                                            <telerik:GridBoundColumn DataField="NumControl" HeaderText="Número Control" UniqueName="NumControl" Display="false" ForceExtractValue="Always">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="NumCard" HeaderText="Número Tarjeta" UniqueName="NumCard" HeaderStyle-Width="80px" FilterControlWidth="60px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" ItemStyle-HorizontalAlign="Center" >
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Line" HeaderText="Linea" UniqueName="Line" Display="false">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="DriverID" HeaderText="Conductor ID" UniqueName="DriverID" Display="false">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="DriverName" HeaderText="Seudónimo" UniqueName="DriverName" HeaderStyle-Width="100px" FilterControlWidth="80px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="GPSImei" HeaderText="GPSImei" UniqueName="GPSImei" HeaderStyle-Width="100px" FilterControlWidth="80px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="GPSImeiName" HeaderText="Nombre GPSImei" UniqueName="GPSImeiName" HeaderStyle-Width="100px" FilterControlWidth="80px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="BusRouteID" HeaderText="Ruta ID" UniqueName="BusRouteID" Display="false">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="BusRouteName" HeaderText="Ruta" UniqueName="BusRouteName" HeaderStyle-Width="100px" FilterControlWidth="80px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Date" HeaderText="Fecha" UniqueName="Date" HeaderStyle-Width="80px" FilterControlWidth="60px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="TimeBegin" HeaderText="Hora Desde" UniqueName="TimeBegin" HeaderStyle-Width="80px" FilterControlWidth="60px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="TimeEnd" HeaderText="Hora Hasta" UniqueName="TimeEnd" HeaderStyle-Width="80px" FilterControlWidth="60px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Status" HeaderText="Estatus" UniqueName="Status" HeaderStyle-Width="100px" FilterControlWidth="80px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="PeopleIn" HeaderText="Personas Entran" UniqueName="PeopleIn" HeaderStyle-Width="70px" FilterControlWidth="50px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" ItemStyle-HorizontalAlign="Center">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="PeopleOut" HeaderText="Personas Salen" UniqueName="PeopleOut" HeaderStyle-Width="70px" FilterControlWidth="50px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" ItemStyle-HorizontalAlign="Center">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="TotalKm" HeaderText="Kms" UniqueName="TotalKm" HeaderStyle-Width="60px" FilterControlWidth="40px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" ItemStyle-HorizontalAlign="Center">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="TotalTrack" HeaderText="Vueltas" UniqueName="TotalTrack" HeaderStyle-Width="60px" FilterControlWidth="40px" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" ItemStyle-HorizontalAlign="Center">
                                            </telerik:GridBoundColumn>
                                        </Columns>

                                        <EditFormSettings>
                                            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                                        </EditFormSettings>

                                        <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                                    </MasterTableView>
                                        <ClientSettings EnableRowHoverStyle="true">
                                            <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">
                                            </Scrolling>  <Selecting AllowRowSelect="True"></Selecting><ClientEvents OnPopUpShowing="PopUpShowing" />
                                        </ClientSettings>
                                    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>

                                    <FilterMenu EnableImageSprites="False"></FilterMenu>
                                </telerik:RadGrid> 

        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server"></telerik:RadWindowManager>

        <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy2" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="btnResumenBusRoutesSearch">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgResumenBusRoutesGrid" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="HiddenFieldError" /> 
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rgResumenBusRoutesGrid">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgResumenBusRoutesGrid" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="HiddenFieldError" /> 
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>

    </form>
</body>
</html>
